var url = require('url');

console.log(JSON.stringify(url.parse('http://10.0.1.23:8080/show/#/api/wall?_=123217867'), null, 2))
console.log(JSON.stringify(url.parse('http://10.0.1.23:8080/show/api/wall?_=123217867'), null, 2))
console.log(JSON.stringify(url.parse('http://10.0.1.23:8080/#/api/wall?_=123217867'), null, 2))
console.log(JSON.stringify(url.parse('http://10.0.1.23:8080?#/api/wall?_=123217867'), null, 2))
console.log(JSON.stringify(url.parse('http://10.0.1.23:8080/show?timestamp=15414651/#/api/wall?_=123217867'), null, 2))

console.log(url.resolve('/', '/api/ws/dataset'))
console.log(url.resolve('/', 'api/ws/dataset'))
console.log(url.resolve('/show', '/api/ws/dataset'))
console.log(url.resolve('/show', 'api/ws/dataset'))

/*
λ node url-parse.js                                                  
{                                                                    
  "protocol": "http:",                                               
  "slashes": true,                                                   
  "auth": null,                                                      
  "host": "10.0.1.23:8080",                                          
  "port": "8080",                                                    
  "hostname": "10.0.1.23",                                           
  "hash": "#/api/wall?_=123217867",                                  
  "search": null,                                                    
  "query": null,                                                     
  "pathname": "/show/",                                              
  "path": "/show/",                                                  
  "href": "http://10.0.1.23:8080/show/#/api/wall?_=123217867"        
}                                                                    
{                                                                    
  "protocol": "http:",                                               
  "slashes": true,                                                   
  "auth": null,                                                      
  "host": "10.0.1.23:8080",                                          
  "port": "8080",                                                    
  "hostname": "10.0.1.23",                                           
  "hash": null,                                                      
  "search": "?_=123217867",                                          
  "query": "_=123217867",                                            
  "pathname": "/show/api/wall",                                      
  "path": "/show/api/wall?_=123217867",                              
  "href": "http://10.0.1.23:8080/show/api/wall?_=123217867"          
}                                                                    
{                                                                    
  "protocol": "http:",                                               
  "slashes": true,                                                   
  "auth": null,                                                      
  "host": "10.0.1.23:8080",                                          
  "port": "8080",                                                    
  "hostname": "10.0.1.23",                                           
  "hash": "#/api/wall?_=123217867",                                  
  "search": null,                                                    
  "query": null,                                                     
  "pathname": "/",                                                   
  "path": "/",                                                       
  "href": "http://10.0.1.23:8080/#/api/wall?_=123217867"             
}                                                                    
{                                                                    
  "protocol": "http:",                                               
  "slashes": true,                                                   
  "auth": null,                                                      
  "host": "10.0.1.23:8080",                                          
  "port": "8080",                                                    
  "hostname": "10.0.1.23",                                           
  "hash": "#/api/wall?_=123217867",                                  
  "search": "?timestamp=15414651/",                                  
  "query": "timestamp=15414651/",                                    
  "pathname": "/",                                                   
  "path": "/?timestamp=15414651/",                                   
  "href": "http://10.0.1.23:8080/?timestamp=15414651/#/api/wall?_=123217867"
}                                                                    
{                                                                    
  "protocol": "http:",                                               
  "slashes": true,                                                   
  "auth": null,                                                      
  "host": "10.0.1.23:8080",                                          
  "port": "8080",                                                    
  "hostname": "10.0.1.23",                                           
  "hash": "#/api/wall?_=123217867",                                  
  "search": "?timestamp=15414651/",                                  
  "query": "timestamp=15414651/",                                    
  "pathname": "/show",                                               
  "path": "/show?timestamp=15414651/",                               
  "href": "http://10.0.1.23:8080/show?timestamp=15414651/#/api/wall?_=123217867"
}
*/